import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import ServiceList from '@/components/serviceList'
import Route from '@/components/route'
import Project from '@/components/project'
import Mine from '@/components/mine'
import Login from '@/components/Login/login'
Vue.use(Router)

export default new Router({
	linkActiveClass: 'active',
	routes: [{
			path: '/',
			redirect: '/home'
		},
		{
			path: '/home',
			name: 'home',
			component: Home,
			meta: {
				keepAlive: true //是否需要缓存
			}
		},
		{
			path: '/route',
			name: 'route',
			component: Route,
			meta: {
				keepAlive: true
			}
		},
		{
			path: '/project',
			name: 'project',
			component: Project,
			meta: {
				keepAlive: true
			}
		},
		{
			path: '/mine',
			name: 'mine',
			component: Mine,
			meta: {
				keepAlive: true
			}
		},
		{
			path: '/login',
			name: 'login',
			component: Login
		},
		{
			path: '/serviceList/:id/:name/:index',
			name: 'ServiceList',
			component: ServiceList
		}
	]
})
